package shejimoshi.gongchangmoshi;

public class SimpleFactory {

    // 工厂类
    public Product createProduct(String type) {
        if (type.equalsIgnoreCase("A")) {
            return new Product_A();
        } else if (type.equalsIgnoreCase("B")) {
            return new Product_B();
        }
        return null;
    }


}


